<% extends "common/msui.html" %>
<% block title %>评价<% endblock %>
<% block body %>
<% set evaluations=_pool.get('product.template').get_evaluations(template_id) %>
<div class="page" id="evaluations" ms-controller='evaluations' >
  <header class="bar bar-nav">
    <a class="button button-link button-nav pull-left back" href="/mshop" >
      <span class="icon icon-left"></span>
      返回
    </a>
    <h1 class="title">全部评价</h1>
  </header>

  <div class="content" >
      <!-- 这个地方line_id其实没有任何用处，但是需要一个line_id必输，所以直接指定为1 -->
      <a ms-repeat='evaluations' ms-attr-href='/mshop/order/evaluation?line_id=1&evaluation_id={{el.id}}' >
          <div class='product-evaluation' >
              <div class='product-evaluation-image'>
                  <img ms-attr-src='/website/image/res.partner/{{el.user_id}}/image' />
                  <span>{{el.username}}</span>
              </div>
              <div class='product-evaluation-content'>
                  <div class='product-evaluation-content-info'><span>{{el.description}}</span></div>
                  <div class='product-evaluation-content-variants'><span>{{el.variants}}</span></div>
              </div>
          </div>
      </a>
  </div>


  <script type="application/javascript" >
    $(function() {
      var evaluations = ${evaluations | tojson | safe}

      var evaluations_vm = avalon.define({
        $id: 'evaluations',
        evaluations: evaluations,
      });

      avalon.scan();
    });


  </script>

<% endblock %>
</div>